<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        		let data = {}
		let key = 'msg'
		Object.defineProperty(data, key, {
				// 当获取值的时候执行
				get() {
					console.log('get: ')
				},
				// 当设置值的时候执行
				set(newValue) {
					console.log('set: ', newValue)
					// 数据更改，更新 DOM 的值
					document.querySelector('#app').textContent = newValue
				},
			})
    </script>
</body>
</html>